﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace GW2LastOnline
{
    public partial class formSearch : Form
    {
        new public event EventHandler TextChanged;

        public formSearch(string search)
        {
            InitializeComponent();
            Fonts.Apply(Fonts.Cabin, label1);

            textSearch.Text = search;
            textSearch.Select(0, textSearch.TextLength);
        }

        new public string Text
        {
            get
            {
                return this.textSearch.Text;
            }
            set
            {
                this.textSearch.Text = value;
            }
        }

        public void SetTextBoxScreenPosition(Point pointOnScreen)
        {
            Point p = this.PointToScreen(textSearch.Location);
            this.Location = new Point(pointOnScreen.X - p.X, pointOnScreen.Y - p.Y);
        }

        private void formSearch_Load(object sender, EventArgs e)
        {

        }

        private void textSearch_TextChanged(object sender, EventArgs e)
        {
            if (TextChanged != null)
                TextChanged(this, e);
        }
    }
}
